/*
 * Copyright 2011 Angel Sanadinov
 *
 * This file is part of VBox WMI.
 *
 * VBox WMI is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VBox WMI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VBox WMI.  If not, see <http://www.gnu.org/licenses/>.
 */

package Beans.Requests.MachineManagement.Components;

/**
 * This class represents the video settings of a virtual machine.
 *
 * @author Angel Sanadinov
 */
public class VideoSettings extends MachineManagementComponent
{
    private int vramSize;                   //the VRAM size in MB
    private boolean is3DAccelerationEnabled;//3D acceleration state
    private boolean is2DAccelerationEnabled;//2D acceleration state

    /**
     * Constructs a video settings object with the specified data.
     *
     * @param vramSize the video RAM size in MB
     * @param is3DAccelerationEnabled 3D acceleration state
     * @param is2DAccelerationEnabled 2D acceleration state
     */
    public VideoSettings(int vramSize, boolean is3DAccelerationEnabled, boolean is2DAccelerationEnabled)
    {
        this.vramSize = vramSize;
        this.is3DAccelerationEnabled = is3DAccelerationEnabled;
        this.is2DAccelerationEnabled = is2DAccelerationEnabled;
    }

    /**
     * Retrieves the size of video RAM on the machine.
     *
     * @return the VRAM size in MB
     */
    public int getVramSize()
    {
        return vramSize;
    }

    /**
     * Retrieves the 3D acceleration state.
     *
     * @return <code>true</code> if 3D acceleration is enabled or <code>false</code>
     *         if it is not
     */
    public boolean getIs3DAccelerationEnabled()
    {
        return is3DAccelerationEnabled;
    }

    /**
     * Retrieves the 2D acceleration state.
     *
     * @return <code>true</code> if 2D acceleration is enabled or <code>false</code>
     *         if it is not
     */
    public boolean getIs2DAccelerationEnabled()
    {
        return is2DAccelerationEnabled;
    }

    @Override
    public boolean isValid()
    {
        if(vramSize > 0)
            return true;
        else
            return false;
    }
}
